package org.example.factory;

import org.example.components.EpsonPrinter;
import org.example.components.HPPrinter;
import org.example.components.Printer;
import org.springframework.stereotype.Component;

@Component
public class PrinterFactory {
    public Printer getPrinter(String type) {
        if ("HP".equalsIgnoreCase(type)) {
            return new HPPrinter();
        } else if ("Epson".equalsIgnoreCase(type)) {
            return new EpsonPrinter();
        }
        return null;
    }
}
